package org.suk.dp.mediator;

/**
 * Description: <br/>
 * @version V1.0  2017/6/22 11:11  by 石冬冬(dongdong.shi@ucarinc.com) - Heil Hitler
 */
public class ConcreteMediator  extends Mediator{
    private  ConcreteColleague1 concreteColleague1;
    private  ConcreteColleague2 concreteColleague2;

    public ConcreteColleague1 getConcreteColleague1() {
        return concreteColleague1;
    }

    public void setConcreteColleague1(ConcreteColleague1 concreteColleague1) {
        this.concreteColleague1 = concreteColleague1;
    }

    public ConcreteColleague2 getConcreteColleague2() {
        return concreteColleague2;
    }

    public void setConcreteColleague2(ConcreteColleague2 concreteColleague2) {
        this.concreteColleague2 = concreteColleague2;
    }

    @Override
    public void send(String message, Colleague colleague) {
        if(colleague.equals(concreteColleague1)){
            concreteColleague2.notify(message);
        }else {
            concreteColleague1.notify(message);
        }
    }
}
